Adds functionality to block vault deposits #6361
Conversation
| { | ||
| auto tx = vault.set({.owner = owner, .id = keylet.key}); | ||
| tx[sfFlags] = tfVaultPrivate; | ||
| tx[sfFlags] = tfVaultDepositBlock | tfVaultDepositUnblock; |
There was a problem hiding this comment.
Reviewer note: tfVaultPrivate and tfVaultDepositBlock have identical numerical values.
There was a problem hiding this comment.
Reviewer note:
tfVaultPrivateandtfVaultDepositBlockhave identical numerical values.
Is that a coincidence, or does it have functional implications?
Also, if you have a reason to want this intentionally, enforce it in the code with a static_assert. (There's an example in the "VaultCreate flags".)
There was a problem hiding this comment.
It's just a coincidence, there are no implications. The comment is to say that even though I changed the flags, the unit-test still tests the same logic: an invalid flag.
There was a problem hiding this comment.
It's just a coincidence, there are no implications. The comment is to say that even though I changed the flags, the unit-test still tests the same logic: an invalid flag.
Oh, I see. tfVaultPrivate was never a valid flag for VaultSet, but since you added tfVaultDepositBlock with the same value, it would have looked valid, so you had to change it to an invalid combo.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## tapanito/lending-fix-amendment #6361 +/- ##
==============================================================
Coverage 81.5% 81.5%
==============================================================
Files 999 999
Lines 74550 74595 +45
Branches 7560 7553 -7
==============================================================
+ Hits 60722 60778 +56
+ Misses 13828 13817 -11
🚀 New features to boost your workflow:
|
Move vault share/asset conversion functions (assetsToSharesDeposit, sharesToAssetsDeposit, assetsToSharesWithdraw, sharesToAssetsWithdraw) and isVaultInsolvent from View.h/View.cpp into a dedicated VaultHelpers.h/VaultHelpers.cpp module. Reorder includes in Vault transactor .cpp files to place own header first. Fix VaultSet flag validation logic.
…ck-deposit # Conflicts: # src/libxrpl/ledger/helpers/VaultHelpers.cpp # src/libxrpl/tx/transactors/vault/VaultClawback.cpp # src/libxrpl/tx/transactors/vault/VaultCreate.cpp # src/libxrpl/tx/transactors/vault/VaultDelete.cpp # src/libxrpl/tx/transactors/vault/VaultDeposit.cpp # src/libxrpl/tx/transactors/vault/VaultWithdraw.cpp # src/test/app/Vault_test.cpp
|
All conflicts have been resolved. Assigned reviewers can now start or resume their review. |
Co-authored-by: Bart <bthomee@users.noreply.github.com>
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
…into tapanito/vault-block-deposit
|
All conflicts have been resolved. Assigned reviewers can now start or resume their review. |
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
eaf80ce to
60700c5
Compare
Specification: XRPLF/XRPL-Standards#469
High Level Overview of Change
Context of Change
Type of Change
.gitignore, formatting, dropping support for older tooling)API Impact
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)